package cn.lf.android.lawfirm.distribution.view;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import java.util.List;

import cn.lf.android.lawfirm.R;
import cn.lf.android.lawfirm.distribution.modle.LawCase;

public class LawDistributionAdapter extends BaseAdapter {
	private List<LawCase> list;
	private LayoutInflater inflater;
	private Activity context;
	private int mPosition = 0;
	int width = 0;
//	private ImageUtil util;

	public LawDistributionAdapter(Activity context, List<LawCase> list) {
		this.context = context;
		this.list = list;
		this.inflater = LayoutInflater.from(context);
//		util = ImageUtilFactory.get();
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = inflater.inflate(R.layout.item_law_distribution, null);
			holder.goods_names = (TextView) convertView
					.findViewById(R.id.names);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		final LawCase bean = list.get(position);

//		holder.goods_names.setText(bean.getProductName());


		return convertView;
	}

	class ViewHolder {
		TextView all_money, all_num, goods_names, creat_time, statue;
		LinearLayout linearlayout, content, ll_money, ll_name, ll_all_num;
		RelativeLayout rl_photo;
		RelativeLayout rl_item;
		ImageView enclosure_one, goods_names_head;
	}

}
